package composite.example;

/**
 * 人力资源是叶节点
 * @author Chen Guang
 * @date 2019/4/18 0018 上午 11:36
 */
public class FinanceDepartment implements Company{

    private String name;

    public FinanceDepartment(String name) {
        this.name = name;
    }

    @Override
    public void add(Company company) {

    }

    @Override
    public void remove(Company company) {

    }

    @Override
    public void display(int depth) {
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < depth; i++) {
            str.append("-");
        }
        str.append(this.name);
        System.out.println(str);
    }

    @Override
    public void lineOfDuty() {
        System.out.println(name + "职责：公司财政收支管理");
    }
}
